import { MockMethod } from "vite-plugin-mock";

const result = {
  errorCode: 0,
  message: "",
  data: [
    {
      id: "9159877732",
      model: "Adam4118",
      name: "zjr2-1",
      memo: "hello world zp 12",
      channels: [
        {
          deviceId: "111",
          address: 2,
          channelIdx: 2,
          enabled: true,
          rangeCode: "07",
          rangeDesc: "4~20mA",
          currentValue: 888888,
          measure: "mA",
          rangeFrom: 4,
          rangeTo: 20
        },
        {
          deviceId: "1112",
          address: 8,
          channelIdx: 8,
          enabled: true,
          rangeCode: "07",
          rangeDesc: "4~20mA",
          currentValue: 888888,
          measure: "mA",
          rangeFrom: 4,
          rangeTo: 20
        }
      ]
    },
    {
      id: "2",
      model: "Adam4118",
      name: "zjr2-12",
      memo: "hello world zp 13",
      channels: [
        {
          deviceId: "9",
          address: 9,
          channelIdx: 9,
          enabled: true,
          rangeCode: "07",
          rangeDesc: "4~20mA",
          currentValue: 888888,
          measure: "mA",
          rangeFrom: 4,
          rangeTo: 20
        },
        {
          deviceId: "10",
          address: 10,
          channelIdx: 10,
          enabled: true,
          rangeCode: "07",
          rangeDesc: "4~20mA",
          currentValue: 888888,
          measure: "mA",
          rangeFrom: 4,
          rangeTo: 20
        },
        {
          deviceId: "11",
          address: 11,
          channelIdx: 11,
          enabled: true,
          rangeCode: "07",
          rangeDesc: "4~20mA",
          currentValue: 888888,
          measure: "mA",
          rangeFrom: 4,
          rangeTo: 20
        }
      ]
    }
  ]
};

export default [
  {
    url: "/api/lab/device/findChannel",
    method: "get",
    response: data => {
      console.log(JSON.stringify(data.query));

      return result;
    }
  }
] as MockMethod[];
